Previous: Highlight Func Mode, Up: Using Semantic [Contents][Index]
Semantic Tag Decoration mode “decorates” each tag
based on certain arbitrary features of that tag. Decorations are
specified using the variable
semantic-decoration-styles.
Toggle Semantic Tag Decoration mode in all Semantic-enabled buffers. With an optional argument arg, enable if arg is positive, and disable otherwise.
The value of this variable is a list of decoration styles
for Semantic Tag Decoration mode. Each element in this list
should have the form (name .
flag), where name is a style
name (a symbol) and flag is non-nil
if the style is enabled.
The following styles are available:
semantic-tag-boundaryPlace an overline in front of each long tag (excluding prototypes).
semantic-decoration-on-private-membersHighlight class members that are designated as private.
semantic-decoration-on-protected-membersHighlight class members that are designated as protected.
semantic-decoration-on-includesHighlight class members that are includes. Clicking on the highlighted include statements opens a context menu for configuring Semantic includes.
To enable or disable specific decorations, use this function:
Prompt for a decoration style, name, and turn
it on or off. With prefix argument arg, turn on if
positive, otherwise off. Return non-nil if the
decoration style is enabled.
Face for long tags in the
semantic-tag-boundary decoration style.
Face for privately-scoped tags in the
semantic-decoration-on-private-members
decoration style.
Face for protected tags in the
semantic-decoration-on-protected-members
decoration style.
Face for includes that are not in some other state, in the
semantic-decoration-on-includes decoration
style.
Face for includes that cannot be found, in the
semantic-decoration-on-includes decoration
style.
Face for includes that have not yet been parsed, in the
semantic-decoration-on-includes decoration
style.
You can create new types of decorations using the following function:
Define a new decoration style with name.
doc is a documentation string describing the
decoration style name. It is appended to
auto-generated doc strings. An optional list of
flags can also be specified. Flags are:
:enabled <value> - specify the default
enabled value for name.
This defines two new overload functions respectively
called NAME-p and NAME-highlight,
for which you must provide a default implementation in
respectively the functions NAME-p-default and
NAME-highlight-default. Those functions are
passed a tag. NAME-p must return
non-nil to indicate that the tag should be
decorated by NAME-highlight.
To put primary decorations on a tag
NAME-highlight, use functions like
semantic-set-tag-face,
semantic-set-tag-intangible, etc., found in the
semantic-decorate library.
To add other kind of decorations on a tag,
NAME-highlight must use
semantic-decorate-tag, and other functions of the
semantic decoration api found in this library.
Previous: Highlight Func Mode, Up: Using Semantic [Contents][Index]